package com.deep.stream.delay.delaycomponent.binder;


import com.deep.stream.delay.delaycomponent.DelayInputConsumer;
import com.deep.stream.pojo.MsgPojo;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * 消费者
 *
 * @author deeprado
 */
@Service
@EnableBinding(DelayInputConsumer.class)
public class DelayInputConsumerBinder {
    @StreamListener("delayTestInput")
    public void receiveDelay(MsgPojo msgPojo) {
        System.out.println(new Date());
        System.out.println(msgPojo.getMsg());
    }
}
